package com.luoxiang.socialandroid.activity;

import static com.luoxiang.socialandroid.common.Constants.MmkvConst.DOMAIN;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.widget.Button;

import com.blankj.utilcode.util.LogUtils;
import com.luoxiang.socialandroid.R;
import com.luoxiang.socialandroid.base.BaseActivity;
import com.luoxiang.socialandroid.utils.CustomClickListener;
import com.luoxiang.socialandroid.utils.JZVideoPlayerStandardLoopVideo;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import cn.jzvd.Jzvd;

public class SeevideoActivity extends BaseActivity {
    private Button icon_back;
    private JZVideoPlayerStandardLoopVideo vv;
    private String pathvideo;
    private int pathvideoint;

    @Override
    protected void initListener() {
        icon_back.setOnClickListener(new CustomClickListener() {
            @Override
            protected void onSingleClick() {
                finish();
            }

            @Override
            protected void onFastClick() {

            }
        });
    }

    @Override
    protected void initLayout(Bundle savedInstanceState) {
        setContentView(R.layout.activity_seevideo);
        setStatusBarTranslucent();
    }

    @Override
    protected void initView() {
        icon_back = findViewById(R.id.icon_back);
        vv = findViewById(R.id.vvs);
        Intent intent = getIntent();
        pathvideo = intent.getStringExtra("pathvideo");
        pathvideoint = intent.getIntExtra("flagvedio", -1);

        LogUtils.i("seevideo", this.pathvideo);
        if (pathvideoint==6){
            vv.setUp(DOMAIN+pathvideo,"");
            vv.startVideo();
        }else {
            vv.setUp(this.pathvideo, "");
            vv.startVideo();
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        vv.reset();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        vv.reset();
    }
}